package fwk.siteManager2.BO {	
	import fwk.loaderManager.LoaderItemGroup;

	
	public class PageData
	{
		
		public var id:String;
		public var uiRessource:String;
		
		public var xmlDescription:XML;
		
		public var x:int = 0;
		public var y:int = 0;
		public var center:Boolean = true;
		public var cache:Boolean = false;
		
		public var listRessources:Array;
		public var listDynamicDisplayElement:Array;
		
		
		public function PageData():void
		{
			listRessources 				= new Array();
			listDynamicDisplayElement 	= new Array();
			
		}
		public function init(xml:XML):void
		{
			id 				= xml.@uipage;
			uiRessource 	 = xml.@uiRessource;
			x = parseInt(xml.@x);
			y = parseInt(xml.@y);
			
			if (String(xml.@center[0]) == "false") center = false;
			if (String(xml.@cache[0]) == "true") cache = true;
			
			xmlDescription = xml;
			
			for (var i:int = 0; i < xml.children().length(); i++) 
			{
				var node:XML = xml.children()[i];
				
				var type:String = node.name() ;

				if (  type != "displayElement")
				{
					var resData:RessourceData = new RessourceData();
					resData.init(  node );
					
					listRessources.push( resData );
				}else {
					
					var de:DisplayElementData = new DisplayElementData();
					de.init( node );
					listDynamicDisplayElement.push(de);
					
				}
				
				
				
			}
			
		}
				
	}
	
	
}